﻿<Window x:Class="TVManager.SeasonWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:app="clr-namespace:TVManager"
    Title="SeasonWindow" Height="800" Width="800">
    <Grid x:Name="rootLayout" Background="White">
        <Grid.Resources>
            <app:EpisdoeFileCountConverter x:Key="episdoeFileCountConverter" />
        </Grid.Resources>
        <ScrollViewer VerticalScrollBarVisibility="Auto">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="250" />
                    <ColumnDefinition Width="3" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>

                <Grid x:Name="seriesGrid" Margin="10" AllowDrop="True">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <TextBlock x:Name="seasonTitle" FontSize="17" FontWeight="Bold" TextWrapping="Wrap" Margin="3" />

                    <CheckBox Grid.Row="1" Content="Watch Season" Margin="3" IsChecked="{Binding WatchSeason, Mode=TwoWay}" />

                    <StackPanel Grid.Row="2" Orientation="Vertical" Margin="0,0,0,10" >
                        <Image x:Name="seasonImage" Margin="3" />
                        <Button x:Name="chooseSeasonImageButton" Content="Choose Image" HorizontalAlignment="Center" />
                    </StackPanel>

                    <TextBlock Text="Episodes" FontWeight="Bold" Grid.Row="3" />
                    <ListBox x:Name="episodesListBox" Grid.Row="4" MaxHeight="250" MinHeight="75" >
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="{Binding EpisodeNameAndNumber}" />
                                    <TextBlock Text="{Binding FileLocation,Converter={StaticResource episdoeFileCountConverter}}" />
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                    
                    <CheckBox Grid.Row="5" x:Name="displayEpisodesCheckbox" Content="Hide episodes without files (* indicates episoes without files)?" TextBlock.FontSize="10" />
                </Grid>
                <GridSplitter Grid.Column="1" Height="Auto" Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"  />
                <app:EpisodeControl x:Name="episodeControl" Grid.Column="2" />
            </Grid>
        </ScrollViewer>
        
        <app:StatusControl x:Name="statusControl" />
    </Grid>
</Window>
